package com.bootdo.lvyou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.lvyou.dao.LvyouCateClassifyDao;
import com.bootdo.lvyou.domain.LvyouCateClassify;
import com.bootdo.lvyou.service.LvyouCateClassifyService;



@Service
public class LvyouCateClassifyServiceImpl implements LvyouCateClassifyService {
	@Autowired
	private LvyouCateClassifyDao lvyouCateClassifyDao;
	
	@Override
	public LvyouCateClassify get(Long id){
		return lvyouCateClassifyDao.get(id);
	}
	
	@Override
	public List<LvyouCateClassify> list(Map<String, Object> map){
		return lvyouCateClassifyDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return lvyouCateClassifyDao.count(map);
	}
	
	@Override
	public int save(LvyouCateClassify lvyouCateClassify){
	
		if(lvyouCateClassify.getId() != null) {
			return lvyouCateClassifyDao.update(lvyouCateClassify);
		}else {
			return lvyouCateClassifyDao.save(lvyouCateClassify);
		}		
	
		
	}
	
	@Override
	public int update(LvyouCateClassify lvyouCateClassify){
		return lvyouCateClassifyDao.update(lvyouCateClassify);
	}
	
	@Override
	public int remove(Long id){
		return lvyouCateClassifyDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return lvyouCateClassifyDao.batchRemove(ids);
	}
	
}
